from matplotlib.pyplot import axis
import numpy as np
import cv2 as cv
from PIL import Image
import os
path = os.path.dirname(__file__)
img = cv.imread(f'{path}/data/chi/1_0.png')
# 图片灰度化
img = cv.cvtColor(img,cv.COLOR_BGR2GRAY)
img = np.float32(img)
# # 图片灰度化
img = cv.imread(f'{path}/data/chi/1_0.png',cv.IMREAD_GRAYSCALE)
# 图片二值化
img = cv.threshold(img, 170, 255, cv.THRESH_BINARY)[1]
# img = cv.cornerHarris(img,2,3,0.04)
image = Image.fromarray(img)
image.show()
note_dic = {}
img[np.all(img==[],axis=-1)]= [255,255,255]
image = Image.fromarray(img)
image.show()
pass